DropOn V1.0 (c) 1994 Scott Gifford For license, see Section VI ---------------------------- ************************************************************* * DropOn is FreeWare--meaning you can use it without charge * * for anything in the licensing agreement (and there isn't * * a whole lot not in the licensing agreement; mostly just * * don't modify and sell it, and if you use it, please * * acknowledge that you have done so). For items which are * * neither specifically granted nor denied in the agreement, * * please contact me. My email and postal address are at * * the bottom of this message. * * * * Thanks, * * ------Scott. * * * ************************************************************* DropOn was written as a way to talk from the command line to an MDI application that supports Drag-And-Drop. This allows any Drag & Drop application to be used as a viewer for programs such as Mosaic, HGopher, the Windows Registration Database, and any other applications that call an external viewer. I. DROPON.INI The most important part of DropOn is its initialization file, "DROPON.INI". This must be located in your Windows directory (Sorry; that's where Windows likes .INI files), and consists of a series of entries describing how an application should be found and launched. The basic syntax is the application name in brackets, followed by a series of "Parameter=Setting" commands. The parameters you can set are: Launch: The name of the file to be launched if the application is not already open. This is the only parameter that must be present. TitleSpec: A regular expression (see IV) describing the title ClassSpec: A regular expression describing the class ModuleSpec: A regular expression describing the module (usually the name of the executable without the .exe) SubWindow: Name of the child window; if left blank, it just drops it on the main window DropLocX: X location of drop; default 0 DropLocY: Y location of drop; default 0 LaunchBreak: Amount of time (in tenths of seconds) to wait between launching and dropping. DropOn first searches for a window which fits all of the specifications in TitleSpec, ClassSpec, or ModuleSpec (if one of these is undefined, it's treated as the * wildcard character, which matches everything). If it finds it, it searches for the subwindow within it whose it name matches SubWindow; if SubWindow is empty, or it cannot find the child window, it drops it on the main one. It drops the file at location (DropLocX,DropLocY), if they are specified, or in the upper-left hand corner (0,0) if they are not, then returns. If it cannot find the described window, it executes the command in Launch; a full path is a good idea. It executes the command exactly how you type it, so feel free to pass it any parameters you want to. It waits the amount of time specified in LaunchBreak (to give the application time to initialize), then goes through the same process above. If it still can't find the window, it reports an error. A sample DROPON.INI is included; you should take a look at it before constructing your own. II. Calling DropOn The syntax for DropOn is fairly simple; just pass it as the first parameter the name of the application, which should appear in brackets in "DROPON.INI", followed by a list of files (wildcards won't work) it should drop onto this application. The formal description would be: dropon APPNAME FILE1 [FILE2, FILE3, ...] And an example is: dropon deskedit c:\windows\dropon.ini This would drop the initialization file on Desktop Editor, my personal favorite text editor. To use DropOn as a viewer within Mosaic or HGopher, you would say, for example: dropon deskedit %f as the viewer for text files. For the first file, it would open a new copy of deskedit (assuming it wasn't already open), and for subsequent files it would simply add them as new MDI (Multiple Document Interface; if there's more than one document open at the same time, it's MDI) documents. Some other ideas are listed at the end. III. Regular Expressions Regular Expressions can be used as values for TitleSpec, ClassSpec, and ModuleSpec, to match patterns of characters rather than an exact match. I translated this code from C code written by J. Kercheval into Pascal for this program, and am not sure how effective a job I did, so if it's not behaving as you expect it to, please let me know. Here's a basic description of the RegEx operators that dropon recognizes, as explained by J. Kercheval: A match would mean that the entire string TEXT is used up in matching the PATTERN and conversely the matched TEXT uses up the entire PATTERN. In the specified pattern string: `*' matches any sequence of characters (zero or more) `?' matches any character `\' suppresses syntactic significance of a special character [SET] matches any character in the specified set, [!SET] or [^SET] matches any character not in the specified set. A set is composed of characters or ranges; a range looks like 'character hyphen character' (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. Other characters are allowed (ie. 8 bit characters) if your system will support them (it almost certainly will). To suppress the special syntactic significance of any of `[]*?!^-\', and match the character exactly, precede it with a `\'. This may or may not be of much use to you, depending on your experience with RegEx pattern matching; if you are used to DOS's wildcards, these are fairly similar. You can use ? and * just as you would expect to, ignore the other features, and get by just fine. IV. Ideas As I mentioned, the reason I wrote DropOn is to be used as a file viewer. If you have an MDI graphics viewer, it can save both time and memory to have the same application display your viewers. Many word processors can display many text formats, so you can use them for RTF files, or anything else that your gopher/Web client knows how to get. Another interesting use is dropping binary and .ZIP files onto a program which serves as a temporary holding place for files (I've seen a few, but am working on my own, so I use a prototype of that. If you look around, though, you can probably find one); then, you can simply drag it off this holding place, and move it to wherever you want it. I have also tried using DROPON as a command in the Registration Database, as the program to launch when a .TXT file is double-clicked in the File Manager or run from the Program Manager, and that worked, too. There are probably lots of other uses for DropOn, too; please contact me if you find an interesting use. V. Bugs and stuff Please send comments, bugs, and compliments to ottscay@umcc.umich.edu, or mail to me at: Scott Gifford 1014 Drury Lane Flushing, MI 48433 Also, please drop me a line, either through email or snail mail, if you are using DropOn. The number of people who are actually using DropOn will determine how lazy I am about updating it. In the next version, I'd like to add a more friendly interface than editing the .ini file, as well as incorporate any good suggestions I get. Thanks ! VI. License Although this program is distributed as FreeWare, it is still copyrighted software, and as such there are certain things you can and cannot do with it. Things you cannot do include distributing it without this license and the accompanying GNU Public License, modifying this software without documenting both the original author (i.e. me), and the programmer or organization who modified it (although you are more than welcome to make such changes), selling modified versions of this program (although you are more than welcome to give them away). You must also obey all conditions stated in the GNU Public License, enclosed here as COPYING. The file MATCHP.PAS is NOT covered under any of these licenses, and is placed entirely in the Public Domain. If you would like the original C source, it is called MATCH110.C, and is available in lots of places. If you can't find it, email me, and I'll send you a copy.